﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using BLToolkit.Data;

namespace MvcVietAir.Models
{
    public class RepositoryCustomer
    {
        private DbManager db = new DbManager("MvcVietAirConnectionString");

        public List<InfoCustomer> GetAll()
        {
            using (db)
            {
                return db.SetSpCommand("Customer_GetAll").ExecuteList<InfoCustomer>();
            }
        }

        public void Create(InfoCustomer cust)
        {
            using (db)
            {
                db.SetSpCommand("Customer_Create", db.CreateParameters(cust)).ExecuteNonQuery();
            }
        }

    }
}